```html
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Reactor 线程模型解析 | 高性能网络架构</title>
    <link rel="stylesheet" href="https://cdn.staticfile.org/font-awesome/6.4.0/css/all.min.css">
    <link rel="stylesheet" href="https://cdn.staticfile.org/tailwindcss/2.2.19/tailwind.min.css">
    <link href="https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@400;500;600;700&family=Noto+Sans+SC:wght@300;400;500;700&display=swap" rel="stylesheet">
    <script src="https://cdn.jsdelivr.net/npm/mermaid@latest/dist/mermaid.min.js"></script>
    <style>
        body {
            font-family: 'Noto Sans SC', Tahoma, Arial, Roboto, "Droid Sans", "Helvetica Neue", "Droid Sans Fallback", "Heiti SC", "Hiragino Sans GB", Simsun, sans-serif;
            color: #333;
            line-height: 1.8;
        }
        h1, h2, h3, h4, h5, h6 {
            font-family: 'Noto Serif SC', serif;
            font-weight: 600;
            color: #2d3748;
        }
        .hero-gradient {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        }
        .card-hover {
            transition: all 0.3s ease;
        }
        .card-hover:hover {
            transform: translateY(-5px);
            box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
        }
        .highlight {
            position: relative;
            z-index: 1;
        }
        .highlight::after {
            content: '';
            position: absolute;
            bottom: 0;
            left: 0;
            width: 100%;
            height: 30%;
            background-color: rgba(118, 75, 162, 0.2);
            z-index: -1;
            transform: scaleX(1.02);
            transform-origin: left;
            transition: all 0.3s ease;
        }
        .highlight:hover::after {
            height: 40%;
            background-color: rgba(118, 75, 162, 0.3);
        }
        .drop-cap::first-letter {
            font-family: 'Noto Serif SC', serif;
            font-size: 4.5rem;
            float: left;
            line-height: 0.8;
            margin-right: 0.8rem;
            color: #667eea;
            font-weight: 700;
        }
    </style>
</head>
<body class="bg-gray-50">
    <!-- Hero Section -->
    <section class="hero-gradient text-white py-20 md:py-32 px-4 md:px-0">
        <div class="container mx-auto max-w-5xl px-4">
            <div class="flex flex-col md:flex-row items-center">
                <div class="md:w-2/3 md:pr-10">
                    <h1 class="text-4xl md:text-5xl font-bold mb-6 leading-tight">Reactor 线程模型解析</h1>
                    <p class="text-xl md:text-2xl opacity-90 mb-8">高性能网络框架的核心设计模式</p>
                    <div class="bg-white bg-opacity-20 backdrop-filter backdrop-blur-sm rounded-lg p-6 mb-8">
                        <p class="text-lg md:text-xl italic">"通过事件驱动和非阻塞I/O，Reactor模式为高并发网络应用提供了优雅的解决方案，在Netty、Java NIO等框架中广泛应用。"</p>
                    </div>
                    <div class="flex flex-wrap gap-4">
                        <span class="px-4 py-2 bg-white bg-opacity-20 rounded-full flex items-center">
                            <i class="fas fa-bolt mr-2"></i> 高并发处理
                        </span>
                        <span class="px-4 py-2 bg-white bg-opacity-20 rounded-full flex items-center">
                            <i class="fas fa-tachometer-alt mr-2"></i> 低延迟
                        </span>
                        <span class="px-4 py-2 bg-white bg-opacity-20 rounded-full flex items-center">
                            <i class="fas fa-expand-arrows-alt mr-2"></i> 可扩展架构
                        </span>
                    </div>
                </div>
                <div class="hidden md:block md:w-1/3 mt-10 md:mt-0">
                    <div class="relative">
                        <div class="absolute inset-0 bg-purple-600 rounded-xl transform rotate-6"></div>
                        <div class="relative bg-white text-gray-800 rounded-xl p-6 shadow-xl">
                            <div class="text-sm font-semibold text-purple-600 mb-2">核心概念</div>
                            <h3 class="font-bold text-lg mb-3">Reactor模式组成</h3>
                            <ul class="space-y-2 text-sm">
                                <li class="flex items-center">
                                    <div class="w-2 h-2 bg-purple-500 rounded-full mr-2"></div>
                                    Reactor - 事件监控与分发
                                </li>
                                <li class="flex items-center">
                                    <div class="w-2 h-2 bg-purple-500 rounded-full mr-2"></div>
                                    Handlers - 事件处理器
                                </li>
                                <li class="flex items-center">
                                    <div class="w-2 h-2 bg-purple-500 rounded-full mr-2"></div>
                                    事件循环机制
                                </li>
                                <li class="flex items-center">
                                    <div class="w-2 h-2 bg-purple-500 rounded-full mr-2"></div>
                                    多路复用技术
                                </li>
                            </ul>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </section>

    <!-- Main Content -->
    <main class="container mx-auto max-w-5xl px-4 py-16">
        <!-- Introduction -->
        <section class="mb-20">
            <div class="prose prose-lg max-w-none">
                <p class="drop-cap">Reactor 线程模型是 Netty 和其他高性能网络框架（如 Java NIO）中广泛使用的一种设计模式，用于处理大量并发的网络连接。它通过高效地管理线程和事件，实现了高吞吐量和低延迟的网络应用。Reactor 线程模型通过高效的事件处理和线程管理，提供了一个灵活和高性能的解决方案，用于处理复杂的网络 I/O 任务。</p>
            </div>
        </section>

        <!-- Core Concepts -->
        <section class="mb-20">
            <div class="flex items-center mb-10">
                <h2 class="text-3xl font-bold mr-4">1. Reactor 线程模型的核心概念</h2>
                <div class="h-1 flex-1 bg-gradient-to-r from-purple-400 to-pink-400 rounded-full"></div>
            </div>
            
            <div class="grid md:grid-cols-2 gap-8 mb-12">
                <div class="bg-white rounded-xl shadow-md overflow-hidden card-hover">
                    <div class="bg-purple-100 px-6 py-4 border-b border-purple-200">
                        <h3 class="text-xl font-semibold text-purple-800 flex items-center">
                            <i class="fas fa-eye mr-3"></i> Reactor
                        </h3>
                    </div>
                    <div class="p-6">
                        <p>负责监控 I/O 事件（如连接请求、数据到达等）并将这些事件分发给相应的事件处理器。</p>
                        <p class="mt-2">Reactor 通常运行在一个或多个线程中，处理 I/O 事件的注册、监听和分发。</p>
                    </div>
                </div>
                <div class="bg-white rounded-xl shadow-md overflow-hidden card-hover">
                    <div class="bg-blue-100 px-6 py-4 border-b border-blue-200">
                        <h3 class="text-xl font-semibold text-blue-800 flex items-center">
                            <i class="fas fa-hand-paper mr-3"></i> Handlers
                        </h3>
                    </div>
                    <div class="p-6">
                        <p>事件处理器，负责处理具体的 I/O 事件。根据事件的类型，Handlers 可能需要读取数据、写入数据或处理连接的状态等。</p>
                    </div>
                </div>
            </div>

            <div class="bg-white rounded-xl shadow-md p-6 mb-8">
                <h3 class="text-xl font-semibold mb-4 flex items-center">
                    <i class="fas fa-project-diagram mr-2 text-purple-600"></i> Reactor模式架构
                </h3>
                <div class="mermaid">
                    graph TD
                    A[客户端请求] --> B(Reactor)
                    B --> C[事件注册]
                    B --> D[事件轮询]
                    B --> E[事件分发]
                    C --> F[Handler1]
                    C --> G[Handler2]
                    D --> E
                    E --> F
                    E --> G
                </div>
            </div>
        </section>

        <!-- Workflow -->
        <section class="mb-20">
            <div class="flex items-center mb-10">
                <h2 class="text-3xl font-bold mr-4">2. Reactor 线程模型的工作流程</h2>
                <div class="h-1 flex-1 bg-gradient-to-r from-blue-400 to-indigo-400 rounded-full"></div>
            </div>

            <div class="relative">
                <div class="absolute left-8 top-0 h-full w-0.5 bg-gradient-to-b from-blue-200 to-purple-200 hidden md:block"></div>
                
                <div class="space-y-12 pl-0 md:pl-16">
                    <!-- Step 1 -->
                    <div class="relative">
                        <div class="absolute -left-6 top-0 h-12 w-12 rounded-full bg-blue-500 text-white flex items-center justify-center shadow-lg hidden md:flex">
                            <span class="text-xl font-bold">1</span>
                        </div>
                        <div class="bg-white rounded-xl shadow-md overflow-hidden card-hover">
                            <div class="bg-blue-50 px-6 py-4 border-b border-blue-100">
                                <h3 class="text-xl font-semibold text-blue-700">事件注册</h3>
                            </div>
                            <div class="p-6">
                                <p>线程注册对特定 I/O 事件（如读、写、连接）的关注，并将这些事件的处理程序（Handlers）关联起来。</p>
                            </div>
                        </div>
                    </div>
                    
                    <!-- Step 2 -->
                    <div class="relative">
                        <div class="absolute -left-6 top-0 h-12 w-12 rounded-full bg-indigo-500 text-white flex items-center justify-center shadow-lg hidden md:flex">
                            <span class="text-xl font-bold">2</span>
                        </div>
                        <div class="bg-white rounded-xl shadow-md overflow-hidden card-hover">
                            <div class="bg-indigo-50 px-6 py-4 border-b border-indigo-100">
                                <h3 class="text-xl font-semibold text-indigo-700">事件轮询</h3>
                            </div>
                            <div class="p-6">
                                <p>Reactor 线程轮询 I/O 事件发生的状态，通常使用高效的 I/O 多路复用技术（如 <code>select</code>、<code>poll</code>、<code>epoll</code>）来检测哪些事件已经发生。</p>
                            </div>
                        </div>
                    </div>
                    
                    <!-- Step 3 -->
                    <div class="relative">
                        <div class="absolute -left-6 top-0 h-12 w-12 rounded-full bg-purple-500 text-white flex items-center justify-center shadow-lg hidden md:flex">
                            <span class="text-xl font-bold">3</span>
                        </div>
                        <div class="bg-white rounded-xl shadow-md overflow-hidden card-hover">
                            <div class="bg-purple-50 px-6 py-4 border-b border-purple-100">
                                <h3 class="text-xl font-semibold text-purple-700">事件分发</h3>
                            </div>
                            <div class="p-6">
                                <p>当 I/O 事件被检测到后，Reactor 将事件及其相关的处理程序（Handlers）分发给相应的处理线程。事件处理线程可以是 Reactor 线程本身，也可以是其他专门的工作线程。</p>
                            </div>
                        </div>
                    </div>
                    
                    <!-- Step 4 -->
                    <div class="relative">
                        <div class="absolute -left-6 top-0 h-12 w-12 rounded-full bg-pink-500 text-white flex items-center justify-center shadow-lg hidden md:flex">
                            <span class="text-xl font-bold">4</span>
                        </div>
                        <div class="bg-white rounded-xl shadow-md overflow-hidden card-hover">
                            <div class="bg-pink-50 px-6 py-4 border-b border-pink-100">
                                <h3 class="text-xl font-semibold text-pink-700">事件处理</h3>
                            </div>
                            <